﻿namespace Jsl.FxCop.Targets
{
    using System.ComponentModel;
    using System.Windows.Forms;

    public class CallComponentsDispose_everything_is_correct : Control
    {
        private Container components;

        protected override void Dispose(bool disposing)
        {
            if (this.components != null)
            {
                this.components.Dispose();
            }

            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
        }
    }

    public class CallComponentsDispose_missing_dispose : Control
    {
        private Container components;

        protected override void Dispose(bool disposing)
        {
            if (this.components != null)
            {
            }

            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
        }
    }

    public class CallComponentsDispose_not_initialized_not_disposed : Control
    {
        private Container components = null;

        protected override void Dispose(bool disposing)
        {
            if (this.components != null)
            {
            }

            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
        }
    }

    public class CallComponentsDispose_no_Dispose_override : Control
    {
        private Container components;

        private void InitializeComponent()
        {
            this.components = new Container();
        }
    }
}